Skip to content

count response codes only once #150

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

minrk
Copy link
Member

@minrk minrk commented Jun 19, 2025

In general, when dealing with buckets, counts must be split over le. But one metric, hubResponseCodes, sums over code only, which ends up counting each request once per bucket they match, since buckets are "less than or equal" and not mutually exclusive, resulting in over-counting requests by ~15x (the number of buckets). I became suspicious when my deployment had ~3k steady 200 responses every 2 minutes with ~20 active users. The real number was ~180.

sum of buckets over code (before this PR):

Screenshot 2025-06-19 at 14 57 50

Sum of buckets over code, le, showing double count:

Screenshot 2025-06-19 at 14 57 35

Sum of count over code (this PR), matches the le=+inf value above:

Screenshot 2025-06-19 at 15 00 37

sum over buckets counts requests once _per bucket_, resulting in over-counting requests by ~15x
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant